package com.esunny.db.hbase;

import java.util.Properties;

import com.esunny.db.DBException;

public abstract class Action {

    protected HBaseClient cli       = new HBaseClient();
    protected String      tableName = "";
    protected int         fieldSize = 0;
    protected int         valueSize = 0;
    protected int         keySpace  = 0;
    protected String      key       = "";

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public int getFieldSize() {
        return fieldSize;
    }

    public void setFieldSize(int fieldSize) {
        this.fieldSize = fieldSize;
    }

    public int getValueSize() {
        return valueSize;
    }

    public void setValueSize(int valueSize) {
        this.valueSize = valueSize;
    }

    public int getKeySpace() {
        return keySpace;
    }

    public void setKeySpace(int keySpace) {
        this.keySpace = keySpace;
    }

    public String getKey() {
        return this.key;
    }

    public void init(Properties props) throws DBException {
        cli.setProperties(props);
        cli.init();
    }

    public abstract void before();

    public abstract int execute();

    public abstract void after();
}
